package org.azmat.demoredis.Redis.RedisRepository;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;

@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash(value = "book", timeToLive = 1000)    // value : 键名   timeToLive : 过期时间
public class Book {
    @Id
    private int id;
    private String name;
    private String category;
    private String author;
    private String price;
}
